package com.ficus.road.maintain.core.model;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * - NORMAL: 正常算法流程 - MOCK: 演示创建的病害 - TAG: 人工标注类型的病害
 */
public enum SourceEnum {
    NORMAL("NORMAL"),
    TAG("TAG"),
    MOCK("MOCK");

    private String value;

    SourceEnum(String value) {
        this.value = value;
    }

    @JsonCreator
    public static SourceEnum fromValue(String value) {
        for (SourceEnum source : SourceEnum.values()) {
            if (source.value.equals(value)) {
                return source;
            }
        }
        throw new IllegalArgumentException("Unexpected enum value '" + value + "'");
    }

    @Override
    @JsonValue
    public String toString() {
        return String.valueOf(value);
    }
}